//
// Created by mac on 1/27/22.
//

using namespace std;
bool isPalindrome(int x) {
    if (x<0||(x%10==0 && x!=0)){ return false;}
    int rev = 0;
    while (rev < x) {
        rev = rev * 10 + x % 10;
        x /= 10;
    }
    return x == rev || rev/10==x;
}